//
//  RHSetViewCell.m
//  RuiHeAppApp
//
//  Created by Jun on 2023/7/20.
//

#import "RHSetViewCell.h"

@interface RHSetViewCell()

@property (nonatomic ,strong) QMUILabel *titleLab;

@property (nonatomic ,strong) QMUILabel *contetLab;

@end

@implementation RHSetViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self){
        [self setupUI];
    }
    return self;
}


- (void)setupUI{
        
    [self setBackgroundColor:UIColor.clearColor];
    [self.contentView setBackgroundColor:UIColor.clearColor];
    
    UIView *bg = [[UIView alloc] init];
    [bg setBackgroundColor:UIColor.whiteColor];
    [self.contentView addSubview:bg];
    
    UIView *lineV = [[UIView alloc] init];
    [lineV setBackgroundColor:CFCellLineColor];
    [bg addSubview:lineV];
    
    _titleLab = [[QMUILabel alloc] init];
    [_titleLab setTextAlignment:NSTextAlignmentLeft];
    [_titleLab setTextColor:kCOLOR_HEX(@"3F4443")];
    [_titleLab setFont:[UIFont systemFontOfSize:16]];
    [bg addSubview:_titleLab];
    

    _contetLab = [[QMUILabel alloc] init];
    [_contetLab setTextAlignment:NSTextAlignmentRight];
    [_contetLab setTextColor:kCOLOR_HEX(@"#AAAAAA")];
    [_contetLab setFont:[UIFont systemFontOfSize:14]];
    [bg addSubview:_contetLab];
    

    UIImageView *arrowV = [[UIImageView alloc] init];
    [arrowV setImage:[UIImage imageNamed:@"cell_arrow"]];
    [bg addSubview:arrowV];
    
    
    kWeakSelf;
    [bg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_offset(15);
        make.right.mas_offset(-15);
        make.top.bottom.mas_offset(0);
        make.height.mas_equalTo(50);
    }];
    
    [lineV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_offset(15);
        make.right.mas_offset(-15);
        make.height.mas_equalTo(1);
        make.bottom.mas_offset(0);
    }];
    
    [arrowV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(20, 20));
        make.right.mas_offset(-15);
        make.centerY.mas_offset(0);
    }];
    
    [_titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_offset(15);
        make.right.equalTo(weakSelf.contetLab.mas_left).offset(-5);
        make.centerY.mas_offset(0);
        make.height.mas_equalTo(30);
    }];
    
    [_contetLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(180);
        make.right.equalTo(arrowV.mas_left).offset(-5);
        make.centerY.mas_offset(0);
        make.height.mas_equalTo(30);
    }];
    
}


- (void)setTitleStr:(NSString *)titleStr{
    _titleStr = titleStr;
    [self.titleLab setText:_titleStr];
}

- (void)setContentStr:(NSString *)contentStr{
    _contentStr = contentStr;
    [self.contetLab setText:_contentStr];
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
